package com.aceitunaproject.server.installation;

import java.util.List;

import com.aceitunaproject.server.entity.installation.Installation;
import com.aceitunaproject.server.entity.unit.Unit;
import com.aceitunaproject.shared.exceptions.gamerules.IllegalActionException;

/**
 * Installation manager interface for handling installation-related operations
 * 
 * @author Federico Bergstein
 */
public interface InstallationManager {

	/**
	 * Builds an installation in the designated coordinates with the designated
	 * unit taking the required materials from the designated sources
	 * 
	 * @param type 
	 * 			  the type of installation to build
	 * @param name
	 *            the name of the new installation
	 * @param positionX
	 *            designated coordinate x
	 * @param positionY
	 *            designated coordinate y
	 * @param unit
	 *            the unit that builds the installation
	 * @param materialSources
	 *            the sources for the needed materials and the number of blocks
	 *            to take from each
	 * @throws IllegalActionException
	 */
	Installation buildInstallation(InstallationType type, String name,
			int positionX, int positionY, Unit unit,
			List<GoodSource> goodSources) throws IllegalActionException;

	/**
	 * Gets an installation from its id
	 * @param id the installation id of the installation to retrieve
	 * @return the installation
	 */
	Installation getInstallation(Long id);

	void buildInstallation(String name, String installationType, Unit unit,
			int x, int y, List<GoodSource> goodSources)
			throws IllegalActionException;;


}
